<template>
	<div id="homedetailed">
		<!-- 商品详情页面 -->
		<!-- 顶部导航 -->
		<topnav></topnav>
		<!-- 内容 -->
		<ProducDetails :list="list" :content="(list.content || {}).content" v-if="list"></ProducDetails>
		<NavConter></NavConter>
	</div>
</template>

<script>
	// 商品列表
	import {
		githomeList
	} from "@/api/home"
	// 引入商品详情组件
	import ProducDetails from '@/components/ProducDetails.vue'
	import topnav from '@/components/topnav.vue'
	import NavConter from '@/components/NavConter.vue'
	export default {
		components: {
			// 商品详情组件
			ProducDetails,
			// 顶部导航
			topnav,
			NavConter
		},
		data() {
			return {
				// 路由传过来的id
				address_id: 0,
				// 商品列表数据
				list: []
			}
		},
		created() {
			// 获取到动态路由匹配的id
			this.Getlist(this.$route.params.id)
			this.address_id = this.$route.params.id;
			this.$route.meta.title = ""
			// this.$route.meta.title = String(this.list.store_name)
		},
		methods: {
			Getlist(address_id) {
				githomeList(address_id).then(res => {
					this.list = res.data.data
				})
			}
		}
	}
</script>

<style>
	#homedetailed {
		width: 100vw;
		min-height: 100vh;
		overflow: hidden;
	}
</style>
